package com.lpit.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lpit.dto.ArticleManagementDto;
import com.lpit.pojo.Article;
import com.lpit.result.ResponseResult;
import com.lpit.vo.ArticleManagementVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "",path = "/article/management")
public interface ArticleManagementControllerApi {
    /**
     * 查看所有的文章
     * @param article
     * @return
     */
    @GetMapping("/list")
    ResponseResult<Page<ArticleManagementVo>> list(ArticleManagementDto article);
    /**
     * 修改文章
     * @return
     */
    @PutMapping
    ResponseResult modify(@RequestBody Article article);

    /**
     * 删除文章
     * @return
     */
    @DeleteMapping("/{id}")
    public ResponseResult delete(@PathVariable Integer id);

    /**
     * 置顶文章
     * @return
     */
    @PutMapping("/contentTop/{id}")
    ResponseResult contentTop(@PathVariable Integer id);

    /**
     * 内容撤回，存放到草稿箱
     * @return
     */
    @PutMapping("/revocation/{id}")
    ResponseResult revocation(@PathVariable Integer id);
}
